<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%@ page import="com.cityeye.util.*"%>
<%@ page contentType="text/html;charset=GB2312"%>
<%
	{
		Page thePage = (Page) request.getAttribute("pagebean");
		String listActionUrl = (String) request
				.getAttribute("listActionUrl");
		if (thePage != null) {
			int showCount=16;
			int curPageNumber = thePage.getCurPage();
			int maxPageNumber = thePage.getMaxPage();
			
			int startNum=curPageNumber-showCount/2;
			if(startNum<1)startNum=1;
			
			int endNum = startNum+showCount;
			if(endNum>maxPageNumber){
				startNum-=endNum-maxPageNumber;
				endNum=thePage.getMaxPage();
			}
%>
<div class="sabrosus">
	<logic:equal name="pagebean" property="curPage" value="1">
		<span class="disabled">&lt; </span>
	</logic:equal>
	<logic:greaterThan name="pagebean" property="curPage" value="1">
		<a href="<%=listActionUrl%>?curPage=<%=curPageNumber - 1%>">&lt;
		</a>
	</logic:greaterThan>
	<%  if (startNum>1){%>
		..	
	<%  }		
	    if(startNum<1)startNum=1;
		
		for (int i = startNum; i <= endNum; i++) {
					if (i == curPageNumber) {
	%>
	<span class="current"><%=i%></span>
	<%
		} else {
	%>
	<a href="<%=listActionUrl%>?curPage=<%=i%>"><%=i%></a>
	<%
		}
		}//end for
		
		if (endNum<maxPageNumber){%>
		..	
	<%  }
		if (thePage.getMaxPage() == thePage.getCurPage()) {
	%>
	<span class="disabled">&gt; </span>
	<%
		} else {
	%>
	<a href="<%=listActionUrl%>?curPage=<%=thePage.getCurPage() + 1%>">&gt;
	</a>
	<%
		}
	%>
</div>
<%
	}
	}
%>

